package com.duowei.kitchenshow.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.duowei.kitchenshow.R;
import com.duowei.kitchenshow.bean.Cfpb_lbbm;

import java.util.List;

public class RvBottomAdapter extends BaseQuickAdapter<Cfpb_lbbm>{

    public RvBottomAdapter(List<Cfpb_lbbm> data) {
        super(R.layout.bottom_item, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, Cfpb_lbbm cfpb_lbbm) {
        int position = baseViewHolder.getPosition();
        if(position==0){
            baseViewHolder.setText(R.id.tv_name,"全部");
        }else{
//            baseViewHolder.setText(R.id.tv_lbbm,cfpb_lbbm.getLbbm());
            baseViewHolder.setText(R.id.tv_name,cfpb_lbbm.getLbmc());
            baseViewHolder.setText(R.id.tv_num,cfpb_lbbm.getSl()+"");
        }

        if(cfpb_lbbm.isClick()){
            baseViewHolder.setBackgroundRes(R.id.rl_bottom,R.drawable.shape_yellow_normal);
        }else{
            baseViewHolder.setBackgroundRes(R.id.rl_bottom,R.drawable.shape_cancel_click);
        }
    }
}
